/**
   A class to process names.
*/
public class Names
{
   /**
      Turns a name "First Last" into a name "Last, First"
      @param firstLast a name such as "Harry Smith", with a space separating
      the first and last name.
      @return a name such as "Smith, Harry", with the last name followed by
      a comma, a space, and the first name.
   */
   public String getLastFirst(String firstLast)
   {
      String asd="";
      int i;
      int l = firstLast.length();
      
      for(i = 0;i<l;i++)
         if(firstLast.charAt(i)==' ')
            break;
            
      for(int j=i+1;j<l;j++){
         char a = firstLast.charAt(j);
         asd=asd+a;
      }
      
      asd=asd+','+' ';
      
      for(int j = 0;j<i;j++){
         char c = firstLast.charAt(j);
         asd=asd+c;
      }
      
      return asd;
   }
}